package com.joyveb.wxs.wx;

import com.google.gson.Gson;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping(value = "/WxController")
public class WxController {

    /**
     * 微信验签
     * @param url
     * @return
     */
    @RequestMapping(value = "/jsapisign", method = RequestMethod.GET)
    @ResponseBody
    public String jsApiSign(String url) {
        //添加微信js签名信息
        System.out.println("url------------"+url);
        Map<String, String> signMap = WXJsapiticket.jsApiSign(url);
        return new Gson().toJson(signMap);
    }

}
